package com.invite.me.ui.home;

import android.Manifest;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.drawable.BitmapDrawable;
import android.os.Build;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentTransaction;
import android.support.v4.view.GravityCompat;
import android.support.v4.widget.DrawerLayout;
import android.text.TextUtils;
import android.util.Log;
import android.view.Gravity;
import android.view.View;
import android.view.ViewGroup;
import android.view.WindowManager;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.PopupWindow;
import android.widget.TextView;

import com.amap.api.location.AMapLocation;
import com.amap.api.location.AMapLocationClient;
import com.amap.api.location.AMapLocationClientOption;
import com.amap.api.location.AMapLocationListener;
import com.bumptech.glide.Glide;
import com.bumptech.glide.load.resource.bitmap.CircleCrop;
import com.bumptech.glide.request.RequestOptions;
import com.invite.me.R;
import com.invite.me.beans.presenter.HomePresenter;
import com.invite.me.base.BaseActivity;
import com.invite.me.beans.presenter.MyInfoEditPresenter;
import com.invite.me.beans.res.HomeTouxiangShouBean;
import com.invite.me.beans.res.NameAtteastationtpBean;
import com.invite.me.ui.cehualan.CityActivity;
import com.invite.me.ui.cehualan.InformationActivity;
import com.invite.me.ui.xiaoxi.InformationxxActivity;
import com.invite.me.ui.cehualan.InvitationCodeActivity;
import com.invite.me.ui.yaoyue.MyInfoActivity;
import com.invite.me.ui.cehualan.MyPriceActivity;
import com.invite.me.ui.cehualan.NameAttestationActivity;
import com.invite.me.ui.registeractivity.RegisterActivity;
import com.invite.me.ui.home.fragment.BlindDataFragment;
import com.invite.me.ui.home.fragment.BusinessFragment;
import com.invite.me.ui.home.fragment.ProgramFragment;
import com.invite.me.ui.yaoyue.MyInfoEditActivity;
import com.invite.me.util.SspPrefUtils;
import com.invite.me.util.StatusBarUtil;
import com.invite.me.wigets.OnHomePageChangeEvent;
import com.invite.me.wlqq.Constants;
import com.invite.me.wlqq.Contract;
import com.luck.picture.lib.PictureSelector;
import com.luck.picture.lib.config.PictureConfig;
import com.luck.picture.lib.config.PictureMimeType;
import com.luck.picture.lib.entity.LocalMedia;

import org.greenrobot.eventbus.EventBus;

import java.io.File;
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import pub.devrel.easypermissions.AppSettingsDialog;
import pub.devrel.easypermissions.EasyPermissions;

public class HomeActivity extends BaseActivity implements View.OnClickListener, EasyPermissions.PermissionCallbacks , Contract.BaseView{


    private final String[] permissions = {
            Manifest.permission.CAMERA, Manifest.permission.ACCESS_COARSE_LOCATION,
            Manifest.permission.READ_EXTERNAL_STORAGE, Manifest.permission.WRITE_EXTERNAL_STORAGE
    };

    HomePresenter homePresenter;


    //声明AMapLocationClient类对象
    public AMapLocationClient mLocationClient = null;

    //声明AMapLocationClientOption对象
    public AMapLocationClientOption mLocationOption = null;

    // 相亲
    BlindDataFragment blindDataFragment;
    // 歌手网红
    ProgramFragment programFragment;
    // 商务活动
    BusinessFragment businessFragment;

    private Fragment[] mFragments;
    private TextView xiangqin;
    private TextView yanchu;
    private TextView shangwuhuodong;
    private DrawerLayout drawerlayout;
    private LinearLayout cehualinearlayout;
    private TextView city;


    private double longitude;
    private double latitude;
    private String district;
    private TextView name;
    private ImageView touxiang;
    private List<LocalMedia> selectList = new ArrayList<>();



    @Override
    protected void onCreate(Bundle savedInstanceState) {
        if (null != savedInstanceState) { // 取出保存的Fragment
            blindDataFragment = (BlindDataFragment) getSupportFragmentManager().getFragment(savedInstanceState, "0");
            programFragment = (ProgramFragment) getSupportFragmentManager().getFragment(savedInstanceState, "1");
            businessFragment = (BusinessFragment) getSupportFragmentManager().getFragment(savedInstanceState, "2");
        }
        //   initLocation();
        // 版本判断。当手机系统大于 23 时，才有必要去动态申请权限
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
            requestPermissions();
        }

        super.onCreate(savedInstanceState);

    }

    private static final int RC_WRITE_PERM = 124;

    /**
     * 申请权限的方法这个是自定义的
     */
    private void requestPermissions() {
        //判断有没有权限
        if (!EasyPermissions.hasPermissions(this, permissions)) {
            EasyPermissions.requestPermissions(
                    this,
                    getResources().getString(R.string.permission_fail_note),
                    RC_WRITE_PERM,
                    permissions);
        }
    }


    /***
     * 初始化经纬度
     */
    private void initLocation() {
        //初始化定位
        mLocationClient = new AMapLocationClient(this);
        //设置定位回调监听
        mLocationClient.setLocationListener(mAMapLocationListener);
        //初始化AMapLocationClientOption对象
        mLocationOption = new AMapLocationClientOption();
        //获取一次定位结果：
        mLocationOption.setOnceLocation(true);
        //给定位客户端对象设置定位参数
        mLocationClient.setLocationOption(mLocationOption);
        //启动定位
        mLocationClient.startLocation();

    }

    //异步获取定位结果
    AMapLocationListener mAMapLocationListener = new AMapLocationListener() {




        @Override
        public void onLocationChanged(AMapLocation amapLocation) {
            if (amapLocation != null) {

                if (amapLocation.getErrorCode() == 0) {
                    Log.e("AMapLocation","进来" );
                    int locationType = amapLocation.getLocationType();//获取当前定位结果来源，如网络定位结果，详见定位类型表
                    //获取纬度
                    latitude = amapLocation.getLatitude();
                    //获取经度
                    longitude = amapLocation.getLongitude();
                    float accuracy = amapLocation.getAccuracy();//获取精度信息
                    String address = amapLocation.getAddress();//地址，如果option中设置isNeedAddress为false，则没有此结果，网络定位结果中会有地址信息，GPS定位不返回地址信息。
                    String country = amapLocation.getCountry();//国家信息
                    String province = amapLocation.getProvince();//省信息
                    String cityy = amapLocation.getCity();//城市信息

                    //城区信息
                    district = amapLocation.getDistrict();
                    String street = amapLocation.getStreet();//街道信息
                    String streetNum = amapLocation.getStreetNum();//街道门牌号信息
                    String cityCode = amapLocation.getCityCode();//城市编码
                    String adCode = amapLocation.getAdCode();//地区编码
                    String aoiName = amapLocation.getAoiName();//获取当前定位点的AOI信息
                    String buildingId = amapLocation.getBuildingId();//获取当前室内定位的建筑物Id
                    String floor = amapLocation.getFloor();//获取当前室内定位的楼层
                    int gpsAccuracyStatus = amapLocation.getGpsAccuracyStatus();//获取GPS的当前状态
                    SspPrefUtils.setString(Constants.JINDU, longitude+"");
                    SspPrefUtils.setString(Constants.WEIDU, latitude+"");
                    SspPrefUtils.setString(Constants.QUYU, district+"");
                    SspPrefUtils.setString(Constants.FANGWU, aoiName+"");
                    SspPrefUtils.setString(Constants.DIZHI, address);
                    SspPrefUtils.setString(Constants.CHENGSHI, cityy);
                    SspPrefUtils.setString(Constants.SHENG, province);

                    //获取定位时间
                    SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
                    Date date = new Date(amapLocation.getTime());
                    String format = df.format(date);
                    Log.e("AMapLocation","" + locationType+"-"+ latitude +"-"+ longitude +"-"+accuracy+"-"+address+"-"+country+"-"+province+"-"+city+"-"+ district +"-"+"街道"+street+"-"+streetNum+"-"+cityCode+"-"+adCode+"-"+aoiName+"-"+buildingId+"-"+floor+"-"+gpsAccuracyStatus);
                    city.setText(cityy);
                    homePresenter.loadHomeData(address, district,cityy, latitude, longitude,province,street);
                    mLocationClient.stopLocation();//停止定位后，本地定位服务并不会被销毁
                }else {
                    Log.e("AmapError","location Error, ErrCode:"
                            + amapLocation.getErrorCode() + ", errInfo:"
                            + amapLocation.getErrorInfo());
                }
            }
        }
    };


    @Override
    protected void initView() {
        homePresenter=new HomePresenter(this);
        StatusBarUtil.setStatusBarColor(this, getResources().getColor(R.color.white));
        if (null == blindDataFragment) blindDataFragment = new BlindDataFragment();
        if (null == programFragment) programFragment = new ProgramFragment();
        if (null == businessFragment) businessFragment = new BusinessFragment();
        mFragments = new Fragment[]{blindDataFragment, programFragment, businessFragment};


        //侧滑栏
        name = findViewById(R.id.name);
        touxiang = findViewById(R.id.touxiang);
        TextView gerenziliao = findViewById(R.id.gerenziliao);
        TextView wodeprice = findViewById(R.id.wodeprice);
        TextView yaoyuejilu = findViewById(R.id.yaoyuejilu);
        TextView shenfenrenzheng = findViewById(R.id.shenfenrenzheng);
        TextView tuichudenglu = findViewById(R.id.tuichudenglu);
        TextView yaoqingma = findViewById(R.id.yaoqingma);
        cehualinearlayout = findViewById(R.id.cehualinearlayout);
        drawerlayout = findViewById(R.id.drawerlayout);
        yaoyuejilu.setOnClickListener(this);
        shenfenrenzheng.setOnClickListener(this);
        wodeprice.setOnClickListener(this);
        gerenziliao.setOnClickListener(this);
        tuichudenglu.setOnClickListener(this);
        yaoqingma.setOnClickListener(this);
        touxiang.setOnClickListener(this);

        //正常布局
        ImageView head = findViewById(R.id.head);
        ImageView xiaoxi = findViewById(R.id.xiaoxi);
        xiangqin = findViewById(R.id.xiangqin);
        yanchu = findViewById(R.id.yanchu);
        shangwuhuodong = findViewById(R.id.shangwuhuodong);
        city = findViewById(R.id.city);
        city.setOnClickListener(this);
        xiangqin.setOnClickListener(this);
        yanchu.setOnClickListener(this);
        shangwuhuodong.setOnClickListener(this);
        xiaoxi.setOnClickListener(this);
        head.setOnClickListener(this);
        xiangqin.setTextColor(this.getResources().getColor(R.color.mywhite));
        yanchu.setTextColor(this.getResources().getColor(R.color.mytubiao));
        shangwuhuodong.setTextColor(this.getResources().getColor(R.color.mytubiao));
        initLocation();
        changeFragment(0);

    }

    @Override
    public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
        super.onRequestPermissionsResult(requestCode, permissions, grantResults);
        // Forward results to EasyPermissions
        EasyPermissions.onRequestPermissionsResult(requestCode, permissions, grantResults, this);
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.xiangqin:
                //相亲
                xiangqin.setTextColor(this.getResources().getColor(R.color.mywhite));
                yanchu.setTextColor(this.getResources().getColor(R.color.mytubiao));
                shangwuhuodong.setTextColor(this.getResources().getColor(R.color.mytubiao));
                changeFragment(0);
                break;
            case R.id.yanchu:
                //歌手
                xiangqin.setTextColor(this.getResources().getColor(R.color.mytubiao));
                yanchu.setTextColor(this.getResources().getColor(R.color.mywhite));
                shangwuhuodong.setTextColor(this.getResources().getColor(R.color.mytubiao));
                changeFragment(1);
                break;
            case R.id.shangwuhuodong:
                //商务活动
                xiangqin.setTextColor(this.getResources().getColor(R.color.mytubiao));
                yanchu.setTextColor(this.getResources().getColor(R.color.mytubiao));
                shangwuhuodong.setTextColor(this.getResources().getColor(R.color.mywhite));
                changeFragment(2);
                break;
            case R.id.head:
                //头像
//                Intent sz=new Intent(MyActivity.this,MySeetActivity.class);
//
//                startActivity(sz);


                drawerlayout.openDrawer(GravityCompat.START);


                break;
            case R.id.xiaoxi:
                //消息


                Intent pwr=new Intent(HomeActivity.this, InformationxxActivity.class);
                startActivity(pwr);


                break;
            //侧边栏
            case R.id.yaoyuejilu:
//邀约记录
                drawerlayout.closeDrawer(GravityCompat.START);
                Intent information = new Intent(HomeActivity.this, InformationActivity.class);
                startActivity(information);

                break;
            case R.id.gerenziliao:
                drawerlayout.closeDrawer(GravityCompat.START);
                Intent headtou = new Intent(HomeActivity.this, MyInfoActivity.class);
                startActivity(headtou);
                break;
            case R.id.shenfenrenzheng:
                //实名认证
                drawerlayout.closeDrawer(GravityCompat.START);
                Intent smrz = new Intent(HomeActivity.this, NameAttestationActivity.class);
                startActivity(smrz);
                break;
            case R.id.wodeprice:
                //转出 我的钱包
                drawerlayout.closeDrawer(GravityCompat.START);

                Intent zhuchu = new Intent(HomeActivity.this, MyPriceActivity.class);
                startActivity(zhuchu);
                break;
            case R.id.city:
                Intent city = new Intent(HomeActivity.this, CityActivity.class);
                startActivity(city);

                break;
            case R.id.tuichudenglu:

                SspPrefUtils.setString(Constants.SSPTOKEN,"");
                SspPrefUtils.setString(Constants.NAKNAME,"");
                Intent dl=new Intent(HomeActivity.this,RegisterActivity.class);
                startActivity(dl);
                finish();
                break;
            case R.id.yaoqingma:
                //邀请码
                drawerlayout.closeDrawer(GravityCompat.START);
                Intent yqm=new Intent(HomeActivity.this,InvitationCodeActivity.class);
                startActivity(yqm);
                break;
            case R.id.touxiang:
                //头像
                gerxiangce();


                break;

        }

    }

    @Override
    protected int getActivityLayoutId() {
        return R.layout.activity_home;
    }

    @Override
    protected void loadData() {

    }

    @Override
    protected void onResume() {
        super.onResume();
        String nekname = SspPrefUtils.getString(Constants.NAKNAME, "");
        String touxiangg = SspPrefUtils.getString(Constants.TOUXIANG, "");

        if(!TextUtils.isEmpty(touxiangg)){
            RequestOptions options = new RequestOptions()
                    .placeholder(R.mipmap.touxiangzhanwei);//占位图
            Glide.with(this)
                    .load(touxiangg)
                    .apply(options )
                    .apply(RequestOptions.bitmapTransform(new CircleCrop()))
                    .into(touxiang);

        }
 if(!TextUtils.isEmpty(nekname)){
            name.setText(nekname);
        }

        String cityy = SspPrefUtils.getString(Constants.SSPCITY, "");
        if(!TextUtils.isEmpty(cityy)){
            city.setText(cityy);
        }

    }

    /**
     * 根据不同的下标切换不同的界面，我的页面隐藏顶部搜索布局
     */
    private void changeFragment(int index) {
        if (index == 0) {
            EventBus.getDefault().post(new OnHomePageChangeEvent());
        }
        // 切换Fragment
        FragmentTransaction fragmentTransaction = getSupportFragmentManager().beginTransaction();
        for (int i = 0; i < mFragments.length; i++) {
            Fragment fragment = mFragments[i];
            if (index == i) {
                if (!fragment.isAdded()) {
                    fragmentTransaction.add(R.id.myframelayout, fragment);
                }
                fragmentTransaction.show(fragment);
//                MobclickAgent.onEvent(this,fragmentName[i]);
            } else {
                fragmentTransaction.hide(fragment);
            }
        }
        fragmentTransaction.commit();
    }

    @Override
    public void onSaveInstanceState(@NonNull Bundle outState) {
        // 保存Fragment
        if (null != mFragments) {
            for (int i = 0; i < mFragments.length; i++) {
                if (null != mFragments[i] && mFragments[i].isAdded())
                    getSupportFragmentManager().putFragment(outState, String.valueOf(i), mFragments[i]);
            }
        }
        super.onSaveInstanceState(outState);

    }


    @Override
    public void onPermissionsGranted(int requestCode, List<String> perms) {
        if (requestCode==RC_WRITE_PERM)    {

            Log.d("onPermissionsGranted" ,"perms:" + perms.toString());
            if (perms.toString() .contains("android.permission.ACCESS_COARSE_LOCATION")){
                initLocation();
            }

        }
    }

    @Override
    public void onPermissionsDenied(int requestCode, List<String> perms) {
        if (EasyPermissions.somePermissionPermanentlyDenied(this, perms)) {
            new AppSettingsDialog.Builder(this)
                    .setTitle(getResources().getString(R.string.permission_dialog_title))
                    .setRationale(getResources().getString(R.string.permission_dialog_msg))
                    .setPositiveButton(getResources().getString(R.string.permission_dialog_ok))
                    .setNegativeButton(getResources().getString(R.string.permission_dialog_cancel))
                    .build()
                    .show();
        }
    }

    @Override
    public void setPresenter(Contract.BasePresenter basePresenter) {
        if (homePresenter instanceof Contract.BasePresenter) {
            this.homePresenter = (HomePresenter) basePresenter;
        }
    }

    @Override
    public void onDataSucess(Object o){
        if(o instanceof NameAtteastationtpBean){
            NameAtteastationtpBean nameAtteastationtpBean= (NameAtteastationtpBean) o;
            String data = nameAtteastationtpBean.getData();
            if(!TextUtils.isEmpty(data)){
                String aa= Constants.TP_URL+data;
               SspPrefUtils.setString(Constants.TOUXIANG,data);
                    RequestOptions options = new RequestOptions()
                            .placeholder(R.mipmap.touxiangzhanwei);//占位图
                    Glide.with(this)
                            .load(aa)
                            .apply(options )
                            .apply(RequestOptions.bitmapTransform(new CircleCrop()))
                            .into(touxiang);


                homePresenter.GengXingTouxiang(aa);

            }




        }else if(o instanceof HomeTouxiangShouBean){

        }




    }

    @Override
    public void onDataFaile(Object o) {

    }

    @Override
    public void onComplete() {

    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        if (mLocationClient != null) {
            //销毁定位客户端之后，若要重新开启定位请重新New一个AMapLocationClient对象。
            mLocationClient.onDestroy();//销毁定位客户端，同时销毁本地定位服务。
        }

    }

    //相册
    private void gerxiangce() {
        PictureSelector.create(HomeActivity.this)
                .openGallery(PictureMimeType.ofImage())// 全部.PictureMimeType.ofAll()、图片.ofImage()、视频.ofVideo()、音频.ofAudio()
                //   .theme(R.style.)// 主题样式设置 具体参考 values/styles   用法：R.style.picture.white.style
                .maxSelectNum(1)// 最大图片选择数量
                .minSelectNum(1)// 最小选择数量
                .imageSpanCount(4)// 每行显示个数
                .selectionMode(PictureConfig.MULTIPLE)// 多选 or 单选
                .previewImage(true)// 是否可预览图片
                //  .previewVideo(cb_preview_video.isChecked())// 是否可预览视频
                //   .enablePreviewAudio(cb_preview_audio.isChecked()) // 是否可播放音频
                .isCamera(true)// 是否显示拍照按钮
                .isZoomAnim(true)// 图片列表点击 缩放效果 默认true
                //.imageFormat(PictureMimeType.PNG)// 拍照保存图片格式后缀,默认jpeg
                //.setOutputCameraPath("/CustomPath")// 自定义拍照保存路径
                .enableCrop(true)// 是否裁剪
              //  .compress(true)// 是否压缩
                .synOrAsy(false)//同步true或异步false 压缩 默认同步
                //.compressSavePath(getPath())//压缩图片保存地址
                .sizeMultiplier(0.5f)// glide 加载图片大小 0~1之间 如设置 .glideOverride()无效
               // .glideOverride(160, 160)// glide 加载宽高，越小图片列表越流畅，但会影响列表图片浏览的清晰度
                .withAspectRatio(1, 1)// 裁剪比例 如16:9 3:2 3:4 1:1 可自定义
                .hideBottomControls(false)// 是否显示uCrop工具栏，默认不显示
                // .isGif(cb_isGif.isChecked())// 是否显示gif图片
                .freeStyleCropEnabled(true)// 裁剪框是否可拖拽
                //  .circleDimmedLayer(cb_crop_circular.isChecked())// 是否圆形裁剪
                .showCropFrame(true)// 是否显示裁剪矩形边框 圆形裁剪时建议设为false
                .showCropGrid(true)// 是否显示裁剪矩形网格 圆形裁剪时建议设为false
                .openClickSound(true)// 是否开启点击声音
                //  .selectionMedia(selectList)// 是否传入已选图片
                .isDragFrame(true)// 是否可拖动裁剪框(固定)
                .videoMaxSecond(15)
                .videoMinSecond(10)
                //.previewEggs(false)// 预览图片时 是否增强左右滑动图片体验(图片滑动一半即可看到上一张是否选中)
                .cropCompressQuality(90)// 裁剪压缩质量 默认100
                .minimumCompressSize(50)// 小于100kb的图片不压缩
                .cropWH(100,200)// 裁剪宽高比，设置如果大于图片本身宽高则无效
                //   .rotateEnabled(true) // 裁剪是否可旋转图片
                .scaleEnabled(true)// 裁剪是否可放大缩小图片
                //.videoQuality()// 视频录制质量 0 or 1
                //.videoSecond()//显示多少秒以内的视频or音频也可适用
                //.recordVideoSecond()//录制视频秒数 默认60s
                .forResult(PictureConfig.CHOOSE_REQUEST);//结果回调onActivityResult code
    }

    @Override
    public void onActivityResult(int requestCode, int resultCode, Intent data) {

        switch (requestCode) {
            case PictureConfig.CHOOSE_REQUEST:
                selectList = PictureSelector.obtainMultipleResult(data);
                String path = "";

                for (int i = 0; i < selectList.size(); i++) {
                    LocalMedia media = selectList.get(i);
                    if (media.isCut() && !media.isCompressed()) {
                        // 裁剪过
                        path = media.getCutPath();
                    } else if (media.isCompressed() || (media.isCut() && media.isCompressed())) {
                        // 压缩过,或者裁剪同时压缩过,以最终压缩过图片为准
                        path = media.getCompressPath();
                    } else {
                        // 原图
                        path = media.getPath();
                    }
                    File file = new File(path);
                    //   文件上传
                    homePresenter.shangchuanweijian(file);
                }


                break;
        }
        super.onActivityResult(requestCode, resultCode, data);

    }

    public void xiazaiapp(String uil, String conten, String gengxintype) {
        View parent = ((ViewGroup) findViewById(android.R.id.content)).getChildAt(0);
        View pop = View.inflate(this, R.layout.upgrade_versions_pop, null);

       TextView shaohougengxin= pop.findViewById(R.id.shaohougengxin);
       TextView gengxin= pop.findViewById(R.id.gengxin);




        final PopupWindow popupWindow = new PopupWindow(pop, ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
        popupWindow.setFocusable(false);
        WindowManager.LayoutParams lp = getWindow().getAttributes();
        lp.alpha = 0.4f;
        getWindow().setAttributes(lp);
        popupWindow.setOutsideTouchable(false);// 设置同意在外点击消失
        popupWindow.setBackgroundDrawable(new BitmapDrawable(getResources(), (Bitmap) null));
        popupWindow.setAnimationStyle(R.style.pop_animation);

        popupWindow.setOnDismissListener(new PopupWindow.OnDismissListener() {
            //在dismiss中恢复透明度
            public void onDismiss() {
                WindowManager.LayoutParams lp = getWindow().getAttributes();
                lp.alpha = 1f;
               getWindow().setAttributes(lp);
            }
        });
        popupWindow.showAtLocation(parent, Gravity.CENTER | Gravity.CENTER_HORIZONTAL, 0, 0);
    }




}